Skip to content

feat(ebuild): add runner args support for flash tools - #161

Merged
srpatcha merged 1 commit into
embeddedos-org:masterfrom
BenjaminGuzman:feat/runner-args
Sep 25, 2026
Merged

srpatcha merged 1 commit into
embeddedos-org:masterfrom
BenjaminGuzman:feat/runner-args

Conversation

@BenjaminGuzman

@BenjaminGuzman BenjaminGuzman commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Allows developers to pass extra arguments to underlying flash tools (like OpenOCD, esptool, pyOCD) without modifying the ebuild source.

Runner arguments are resolved using the following precedence chain:

  1. CLI passthrough
  2. Environment variable (EBUILD_FLASH_RUNNER_ARGS)
  3. Project configuration

Type of Change

  • feat - New feature
  • fix - Bug fix
  • docs - Documentation only
  • style - Formatting, no code change
  • refactor - Code restructuring without behavior change
  • test - Add or fix tests
  • build - Build system or dependency changes
  • ci - CI/CD pipeline changes
  • perf - Performance improvement

Changes

  • Implemented _resolve_runner_args utility function to handle precedence of runner arguments via CLI, Environment, and build.yaml.
  • Added support for arbitrary underlying arguments in the flash subcommand using Click's ignore_unknown_options=True context setting.
  • Added a --no-runner-args flag to safely and explicitly clear argument overrides.
  • Injected resolved arguments correctly for openocd, esptool, pyocd, nrfjprog, and stflash.
  • Updated docstring to document the feature.

Testing

Pre-Submission Checklist

  • Code compiles without warnings (-Wall -Wextra -Werror for C)
  • All existing tests pass
  • New tests added for new functionality
  • Documentation updated if API changed
  • Commit messages follow the <type>(<scope>): <description> convention
  • Branch is rebased on latest master
  • This PR links a real issue in this repository with a closing keyword

Related Issue

Closes #162

Screenshots / Logs

Screenshot 2026-09-24 at 13 56 46

Additional Notes

  • UX tradeoff: If flash command seamlessly accept unrecognized options, ebuild will no longer throw a "No such option" validation error if a user makes a typo on a native argument (e.g., typing --targt instead of --target). Instead, the typo will be silently consumed and forwarded to the runner tool, which will eventually throw its own error. This is an accepted tradeoff to optimize for the developer experience, but of course I'm also open to change the behavior to be more constrained and less lax.

Allows developers to pass extra arguments to underlying
flash tools (like OpenOCD, esptool, pyOCD) without
modifying the ebuild source.

Runner arguments are resolved using the following
precedence chain:

1. CLI passthrough
2. Environment variable (EBUILD_FLASH_RUNNER_ARGS)
3. Project configuration

Signed-off-by: Benjamín Guzmán <[email protected]>
@BenjaminGuzman
BenjaminGuzman marked this pull request as ready for review September 24, 2026 20:17
@srpatcha
srpatcha merged commit 31c0062 into embeddedos-org:master Sep 25, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Allow passing custom runner arguments to flash tools via CLI, env, and config

2 participants